//
//  CellOfIMapCommendScenicSpotView.m
//  FreeTravel
//
//  Created by 徐康 on 16/9/3.
//  Copyright © 2016年 KX. All rights reserved.

#import "FreeTravelMacro.h"
#import "Masonry.h"
#import "UIImageView+WebCache.h"
#import "CellOfIMapCommendScenicSpotView.h"
@interface CellOfIMapCommendScenicSpotView ()
@property (nonatomic, strong) UIImageView *imageViewOfMap;
@property (nonatomic, strong) UILabel *label;
@property (nonatomic, assign) CGRect rect;
@property (nonatomic, strong) UIView *grayView;
@end
@implementation CellOfIMapCommendScenicSpotView
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageViewOfMap = [[UIImageView alloc]init];
        self.grayView = [[UIView alloc]init];
        self.label = [[UILabel alloc]init];
        [self.contentView addSubview:self.grayView];
        [self.contentView addSubview:self.imageViewOfMap];
        [self.contentView addSubview:self.label];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    
    [self.imageViewOfMap mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.left.right.equalTo(self.contentView);
    }];
    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.contentView);
        make.height.mas_offset(30);
        
    }];
    self.label.backgroundColor = [UIColor whiteColor];
    self.label.alpha = 0.8;
    self.label.layer.borderColor = COLORFORFREETRAVEL.CGColor;
    self.label.layer.borderWidth = 1;
    self.label.textColor = COLORFORFREETRAVEL;
    self.label.layer.cornerRadius = 15;
    self.label.layer.masksToBounds = YES;
    self.label.font = [UIFont systemFontOfSize:15];
    [self.grayView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.contentView);
        make.height.mas_offset(4);
    }];
    self.grayView.backgroundColor = [UIColor lightGrayColor];
}
- (void)setModel:(ModelOfDataCommendScenicSpotView *)model{
    _model = model;
    [self.imageViewOfMap sd_setImageWithURL:[NSURL URLWithString:model.city_map]];
    self.label.text = [NSString stringWithFormat:@"%@地图",model.cnname];
    
    
    
    
    
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
